<!--<%'--------------------    HTMLStart Code (Client and Server) ------------------%>-->



<script type="text/javascript" src="/components_cb/client/scriptinc_js.htm"></script>

<script type="text/javascript" src="/components_cb/client/scriptinc_nocache_js.htm"></script>

<script type="text/javascript" src="/components_cb/client/htmlstart.min.js"></script>

<!--<%'-------------------------- Server side includes -------------------------%>-->
<!--#include virtual="\components_cb\client\initDialogEnv_tagged.inc"-->
<!-- #include virtual='/components_cb/server/controls.inc' -->
<!-- #include virtual="/components_cb/server/getrights.inc"-->
<!--<%'-------------------------- Create global Variables ----------------------%>-->

<script type="text/javascript">
    window.returnValue = false;
</script>

<!--<%'-------------------------- Blank XML islands ----------------------%>-->

<script type="text/javascript">
    var otblForms;
    var xmlForms = NewXmlDOM(false);
    var xmlFormsOrg = NewXmlDOM(false);
    var xmlProperties = NewXmlDOM(false);
    var xmlControls_WATCH_Initialize = NewXmlDOM(false);
    var rootPath = top.ShellAddress.replace("/100", "");
    xmlForms.loadXML("<Forms />");
    StoreDataXml("xmlForms", xmlForms);
</script>

<script type="text/javascript">
    var pageStage = '';
    var LoadData = "0";
    var sPropID = "0";
    function InitialLoad_Start() {
        var sXMLRequest = "<Page><Request LoadData='" + LoadData + "' SiteID = '" + sPropID + "'/></Page>";
        InitialLoad_GetData("", top.ShellAddress + "DocumentManagement/ASPX/Forms.aspx/GetFormReport", sXMLRequest);
    }

    function InitialLoad_onDataReady() {        
        if (LoadData == "1") {
            InitialLoad_FillXML("Forms", 'xmlForms', "");
            InitialLoad_FillXML("Forms", 'xmlFormsOrg', "");
        }
        InitialLoad_FillXML("Properties", 'xmlProperties', "");
        Controls_AddSelectTextToXML(xmlProperties, "property", "SiteID", "SiteName");
    }

    function InitialLoad_onComplete() {
        Controls_Initialize();
        afterBinding();
        xmlControls_WATCH_Initialize.async = false;
        xmlControls_WATCH_Initialize.loadXML("<Row a='1' />");
        StoreDataXml("xmlControls_WATCH_Initialize", xmlControls_WATCH_Initialize);
        top.resizeDialog(bUsingIframe);
        top.setCustomDialogWidth(930);
        top.setCustomDialogHeight(750);
        top.setActionButtonsPosition(0, 0, window);

    }

    function afterBinding() {
        Controls_WATCH_Initialize();
        Initialize();
    }

    function Initialize() {
        rpiModalHeader.setLoadIndicator(false);
        otblForms.updateTable();
        if ($(xmlForms).find("Row").length == 0) {
            otblForms.displayMessage("No errors");
        }
        $("#selPropertyFilter").focus();
        $("#selPropertyFilter").val(sPropID);
        $("#btnFind").prop("disabled", false);
    }

    function doClose() {
        window.returnValue = false;        
        top.hideDialog(window.returnValue, window, bUsingIframe);
    }

    function doPrint() {


    }

    function doSupertablePrintCallback() {
        openSupertablePrintModal();
        //window.print();
    }

    function filterProperties() {
        var siteID = Controls_GetSelectValue(selProperty);

        xmlForms.loadXML($(xmlFormsOrg).get(0).xml);

        if (siteID == -1) {
            while ($(xmlForms.documentElement).find('Row[SiteID != ""]').length > 0) {
                $(xmlForms.documentElement).find('Row[SiteID != ""]').remove().end();
            }
        }
        else if (siteID != 0) {
            while ($(xmlForms.documentElement).find('Row[SiteID != "' + siteID + '"]').length > 0) {
                $(xmlForms.documentElement).find('Row[SiteID != "' + siteID + '"]').remove().end();
            }
        }

        //tblForms.buildBodyTable();
        otblForms.updateTable();
        if ($(xmlForms).find("Row").length == 0) {
            otblForms.displayMessage("No errors");
        }
    }
    function doFind() {
        if ($("#selPropertyFilter").val() === "") {
            top.SetPSCurrent("BodyText", "Please select a property");
            top.SetPSCurrent("Caption", "Validation");
            top.SetPSCurrent("ImageLabel", "Property Required");
            top.NavSuperModal('attention', window);
            top.RemovePageState('BodyText');
            top.RemovePageState('Caption');
            top.RemovePageState('ImageLabel');
            return;
        }
        doChange();
    }
    function doChange() {
        sPropID = $("#selPropertyFilter").val();
        LoadData = "1";

        if (sPropID == '') {
            xmlForms.loadXML("<Forms />");
            StoreDataXml("xmlForms", xmlForms);
            otblForms.updateTable();
        }
        else {
            rpiModalHeader.setLoadIndicator(true);
            $("#btnFind").attr("disabled", true);
            InitialLoad_Start();
        }
    }
</script>

<html>
<head>
    <title>OneSite</title>
    <link rel="stylesheet" type="text/css" href="/components_cb/styles/base.min.css" />
    <link rel="stylesheet" type="text/css" href="/components_cb/styles/form.min.css" />
</head>
<% call CreateImports("errorhandling")%>
<% call CreateImports("modalheader")%>
<% call CreateImports("supertable")%>
<body class="datamodal" tabindex="-1">
    <div class='RPI_MODALHEADER' id="rpiModalHeader" pagetrail="Forms library - " pagelabel="Forms Report"
        pageid="101.055.100.020">
    </div>
    <br />
    <table id="tblFormsHeader" width='870px' cellpadding="0" cellspacing="1" border='0'>
        <tr>
            <td style="font: bold 12pt arial; color: #000000;">
                <nobr>Forms</nobr>
            </td>
            <td style='width: 100%'>
                &nbsp;
            </td>
            <td style="text-align: left; vertical-align: middle;">
                Property
            </td>
            <td style="text-align: left; vertical-align: middle;">
                <%Call Controls_CreateSelectDynamic("selPropertyFilter","","","1","","","","","xmlProperties","Properties","SiteName","SiteID","") %>
            </td>
            <td style="text-align: center; width: 100%; padding-left: 3px;">
                <%=Controls_CreateButtonCustom("btnFind","Find","doFind();","","50","10","","",""," disabled=true;")%>
            </td>
        </tr>
    </table>
    <div id="divForms">
        <div class="RPI_SUPERTABLE" id="tblForms" rpdatasource="xmlForms" rpdatanode="Forms"
            rpheader="true" rpwidth="870px" rpheight="560px" rppagesize="30" rpmaxpagelinks='10'
            rpprint="true">
            <table style="display: none">
                <thead>
                    <tr style='height: 30px;'>
                        <th class="center" style="width: 200px;">
                            <span title="Click to sort" style="color: #ffffff; font-weight: bold;">Form Name</span>
                        </th>
                        <th class="center" style="width: 40px;">
                            <span title="Click to sort" style="color: #ffffff; font-weight: bold;">Version</span>
                        </th>
                        <th class="center" style="width: 70px;">
                            <span title="Click to sort" style="color: #ffffff; font-weight: bold;">Classification</span>
                        </th>
                        <th class="center" style="width: 30px;">
                            <span title="Click to sort" style="color: #ffffff; font-weight: bold;">Seed</span>
                        </th>
                        <th class="center" style="width: 80px;">
                            <span title="Click to sort" style="color: #ffffff; font-weight: bold;">Form Type</span>
                        </th>
                        <th class="center" style="width: 60px;">
                            <span title="Click to sort" style="color: #ffffff; font-weight: bold;">Center</span>
                        </th>
                        <th class="center" style="width: 60px;">
                            <span title="Click to sort" style="color: #ffffff; font-weight: bold;">Activation Date</span>
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td style="text-align: left;" rpdatafld="Description" rpnowrap="true" />
                        <td style="text-align: left;" rpdatafld="VersionLabel" rpnowrap="true" />
                        <td style="text-align: left;" rpdatafld="FormClassification" rpnowrap="true" />
                        <td style="text-align: left;" rpdatafld="Seed" rpnowrap="true" >
                        <!--# if(@Seed === '1') { -->
				            Yes
				        <!--# } else { -->    
				            No
				         <!--# } -->
                        </td>
                        <td style="text-align: left;" rpdatafld="FormTypeDescription" rpnowrap="true" />
                        <td style="text-align: left;" rpdatafld="Center" rpnowrap="true" />
                        <td style="text-align: left;" rpdatafld="ActivationDate" rpnowrap="true" />
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
     <div class="IFrameButtons">
        <table id="buttons" border="0">    
        <tr>
            <td>
                
            </td>
            <td>
                <%call Controls_CreateButton("btnClose","Close","doClose()","1","","")%>
            </td>
        </tr>
        </table>
     </div>

    <!-- Code to know when binding is done. -->
    <input type="hidden" value="~" datasrc="#xmlControls_WATCH_Initialize" datafld="a"
        onpropertychange="this.onpropertychange='';afterBinding();" id="Hidden1" name="Hidden1" />
</body>

<script type="text/javascript">
    $(window).load(function() {
        InitialLoad_ScreenReady();
        otblForms = $("#tblForms").data("ST");
        InitialLoad_Start();
    });
    var oCBConverted = { 'ie': true, 'firefox': true, 'chrome': true, 'safari': true };   
</script>

</html>
